#pragma once

#include "Character.h"
#include "PickUp.h"
#include "MessageBoard.h"

#define CHAR_LIMIT_JUMP		15.0f
#define CHAR_IDLE_TIME		30.0f

/**
	* Class for Enemy
	* FSM
	* Enemy Movement
	* AI
	* Spawning
*/

class Enemy : public Object{
private:
	float jumpLimit, sightLength;

	Vector3D oldDir;

	bool jumpMe, saveDir;

	float damage;
public:
	vector<Object *> TargetInfoList;

	CCountdownTimer countdownTimer;

	BoundingBox spaceCheck;

	int rndNum, id;

	bool enemyDetected, renderWeapon, defendTime;

	Character *playerInfo;

	BoundingLine lineOfSight;

	Object weapon;

	MessageBoard *Board;

	Enemy(void);
	~Enemy(void);

	void LoadPlayerInfo(Character *player);
	void LoadTargetInfo(Object *target);
	void LoadMessageBoard(MessageBoard *Board);
	
	void SetAttackDamage(float damage);
	float GetAttackDamage(void);

	void SetLengthOfSight(float sightLength);

	void WallHit(float elapsed);
	void Jump(float elapsed);

	void CreatePickUp( Vector3D position, Item::no itemNumber, vector<PickUp *> *PickUpList );
	virtual void DropItemOnDeath(vector<PickUp *> *PickUpList){
	};

	virtual void RenderObject(void);

	/**
		* Function to update the Enemy.
		*
		* If called, will simulate the movement of the Enemy around the level.
		* @param Elapsed time for frame independent movement.
	*/
	virtual bool UpdateObject(Vector3D offset, float elapsed);
};